/*
 * Exception.h
 *
 *  Created on: 2011-11-16
 *      Author: kaishui
 */

#ifndef EXCEPTION_H_
#define EXCEPTION_H_

#include "DateTime.h"

class Exception //:public exception
{
  public:
	Exception() throw() {}
     ~Exception() throw() {};

    /** Returns a C-style character string describing the general cause
     *  of the current error.  */
  //  virtual const char* what() const throw();
    virtual void ShowReason(){};

};


//mysqlÊýŸÝ¿âÒì³£Àà
class mysql_Exception : public Exception
{
public:
	mysql_Exception(MYSQL* conn) throw() {m_conn=conn;};
	//virtual ~mysql_Exception() throw();
	virtual void ShowReason();
private:
	MYSQL* m_conn;
};

#define GET_NAME(n)  #n
//¿ÕÖžÕëÒì³£Àà
class nullpoint_Exception : public Exception
{
public:
	nullpoint_Exception(string info) throw() {this->info=info;};
	virtual void ShowReason();
private:
	string info;
};




#endif /* EXCEPTION_H_ */
